#include <stdlib.h>
#include <stdio.h>
#include "../include/memory.h"

Memory *memory_create(int size)
{
	int i;
	Memory *memory = (Memory *) malloc(sizeof(Memory));
	memory-> size = size;

		
	for (i=0; i< size ; ++i) // inicializacao da memoria
	{
		memory->word[i] = i*2 ;
	}
	
	return memory;
}

int read_mem(int add, Memory *memory)
{

	return (*memory).word[add];//aqui da erro
}

int write_mem (int add, int data, Memory *memory) //falta implementar
{
	(*memory).word[add] = data;//aqui da erro
	return 0;
}
